<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>EBP开发平台</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="${request.contextPath}/statics/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="${request.contextPath}/statics/dist/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="${request.contextPath}/statics/dist/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="${request.contextPath}/statics/dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="${request.contextPath}/statics/dist/css/skins/all-skins.min.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/main.css">
    <!--http://aimodu.org:7777/admin/index_iframe.html?q=audio&search=#-->
    <style type="text/css">

    </style>
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="${request.contextPath}/statics/plugins/ie9/html5shiv.min.js"></script>
    <script src="${request.contextPath}/statics/plugins/ie9/respond.min.js"></script>
    <![endif]-->
</head>
<body class="hold-transition skin-blue sidebar-mini fixed">
<div class="wrapper" id="rrapp">

    <header class="main-header">
        <!-- Logo -->
        <a href="javascript:void(0);" class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini"><b>EBP</b></span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg"><b>EBP开发平台</b></span>
        </a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            <div style="float:left;color:#fff;padding:15px 10px;">欢迎 {{user.username}}</div>
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <li><a href="javascript:;" @click="updatePassword"><i class="fa fa-lock"></i> &nbsp;修改密码</a></li>
                    <li><a href="logout"><i class="fa fa-sign-out"></i> &nbsp;退出系统</a></li>
                </ul>
            </div>
        </nav>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
            <!-- /.search form -->
            <!-- sidebar menu: : style can be found in sidebar.less -->
            <ul class="sidebar-menu">

            </ul>
        </section>
        <!-- /.sidebar -->
    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper" id="content-wrapper" style="min-height: 421px;">
        <!--bootstrap tab风格 多标签页-->
        <div class="content-tabs">
            <button class="roll-nav roll-left tabLeft" onclick="scrollTabLeft()">
                <i class="fa fa-backward"></i>
            </button>
            <nav class="page-tabs menuTabs tab-ui-menu" id="tab-menu">
                <div class="page-tabs-content" style="margin-left: 0px;">

                </div>
            </nav>
            <button class="roll-nav roll-right tabRight" onclick="scrollTabRight()">
                <i class="fa fa-forward" style="margin-left: 3px;"></i>
            </button>
            <div class="btn-group roll-nav roll-right">
                <button class="dropdown tabClose" data-toggle="dropdown">
                    页签操作<i class="fa fa-caret-down" style="padding-left: 3px;"></i>
                </button>
                <ul class="dropdown-menu dropdown-menu-right" style="min-width: 128px;">
                    <li><a class="tabReload" href="javascript:refreshTab();">刷新当前</a></li>
                    <li><a class="tabCloseCurrent" href="javascript:closeCurrentTab();">关闭当前</a></li>
                    <li><a class="tabCloseAll" href="javascript:closeOtherTabs(true);">全部关闭</a></li>
                    <li><a class="tabCloseOther" href="javascript:closeOtherTabs();">关闭其他</a></li>
                </ul>
            </div>
            <button class="roll-nav roll-right fullscreen" onclick="App.handleFullScreen()"><i
                    class="fa fa-arrows-alt"></i></button>
        </div>
        <div class="content-iframe " style="background-color: #ffffff; ">
            <div class="tab-content " id="tab-content">

            </div>
        </div>
    </div>
    <!-- /.content-wrapper -->

    <footer class="main-footer">
        <div class="pull-right hidden-xs">
            <b>Version</b> 2.3.8
        </div>
        <strong>Copyright &copy; 2014-2018 <a href="http://www.sdehualu.com" style="font-style: italic; color:red;">e·Hualu</a>.</strong> All rights
        reserved.
    </footer>

    <!-- /.control-sidebar -->
    <!-- Add the sidebar's background. This div must be placed
         immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>

    <!-- 修改密码 -->
    <div id="passwordLayer" style="display: none;">
        <form class="form-horizontal">
            <div class="form-group">
                <div class="form-group">
                    <div class="col-sm-2 control-label">账号</div>
                    <span class="label label-success" style="vertical-align: bottom;">{{user.username}}</span>
                </div>
                <div class="form-group">
                    <div class="col-sm-2 control-label">原密码</div>
                    <div class="col-sm-10">
                        <input type="password" class="form-control" v-model="password" placeholder="原密码"/>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-2 control-label">新密码</div>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" v-model="newPassword" placeholder="新密码"/>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<!-- ./wrapper -->

<!-- jQuery 2.2.3 -->
<script src="${request.contextPath}/statics/plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- Vue.js v2.2.6 -->
<script src="${request.contextPath}/statics/libs/vue.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="${request.contextPath}/statics/libs/bootstrap.min.js"></script>
<!-- Slimscroll -->
<script src="${request.contextPath}/statics/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="${request.contextPath}/statics/plugins/fastclick/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="${request.contextPath}/statics/dist/js/app.js"></script>
<!-- layer-v3.0.1 -->
<script src="${request.contextPath}/statics/plugins/layer/layer.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="${request.contextPath}/statics/dist/js/demo.js"></script>
<!--tabs-->
<script src="${request.contextPath}/statics/dist/js/app_iframe.js"></script>

<script type="text/javascript">


    $(function () {
//        console.log(window.location);

        App.setbasePath("${request.contextPath}/statics/");
        App.setGlobalImgPath("/dist/img/");

        addTabs({
            id: '10008',
            title: '欢迎页',
            close: false,
            url: 'main.html?sessionId=${sessionId}',
            urlType: "relative"
        });

        App.fixIframeCotent();


        var menus = [
            {
                id: "9000",
                text: "header",
                icon: "",
                isHeader: true
            },
            {
                id: "9001",
                text: "UI Elements",
                icon: "fa fa-laptop",
                children: [
                    {
                        id: "90011",
                        text: "用户管理",
                        icon: "fa fa-user",
                        url: "modules/sys/user.html",
                        targetType: "iframe-tab"
                    },
                    {
                        id: "90012",
                        text: "icons",
                        url: "UI/icons_iframe.html",
                        targetType: "iframe-tab",
                        icon: "fa fa-circle-o"
                    }
                ]
            },
            {
                id: "9002",
                text: "Forms",
                icon: "fa fa-edit",
                children: [
                    {
                        id: "90021",
                        text: "advanced",
                        url: "forms/advanced_iframe.html",
                        targetType: "iframe-tab",
                        icon: "fa fa-circle-o"
                    },
                    {
                        id: "90024",
                        text: "百度",
                        url: "https://www.baidu.com",
                        targetType: "iframe-tab",
                        icon: "fa fa-circle-o",
                        urlType: 'abosulte'
                    }
                ]
            }
        ];

        var menus1 =
        {
            "msg": "success",
            "menuList": [{
            "menuId": "1",
            "parentId": "0",
            "parentName": null,
            "name": "权限管理",
            "url": null,
            "perms": null,
            "type": 0,
            "icon": "fa fa-cog",
            "orderNum": 0,
            "open": null,
            "list": [{
                "menuId": "998754926798696450",
                "parentId": "1",
                "parentName": null,
                "name": "二级菜单",
                "url": null,
                "perms": null,
                "type": 0,
                "icon": null,
                "orderNum": 0,
                "open": null,
                "list": [{
                    "menuId": "998755180675723266",
                    "parentId": "998754926798696450",
                    "parentName": null,
                    "name": "三级菜单",
                    "url": "http://www.baidu.com",
                    "perms": null,
                    "type": 1,
                    "icon": null,
                    "orderNum": 0,
                    "open": null,
                    "list": null
                }]
            }, {
                "menuId": "2",
                "parentId": "1",
                "parentName": null,
                "name": "用户管理",
                "url": "modules/sys/user.html",
                "perms": null,
                "type": 1,
                "icon": "fa fa-user",
                "orderNum": 1,
                "open": null,
                "list": null
            }, {
                "menuId": "31",
                "parentId": "1",
                "parentName": null,
                "name": "部门管理",
                "url": "modules/sys/dept.html",
                "perms": null,
                "type": 1,
                "icon": "fa fa-file-code-o",
                "orderNum": 1,
                "open": null,
                "list": null
            }]
        }],
            "code": 0
        }

        //$('.sidebar-menu').sidebarMenu({data: menus1.menuList});

        // 动态创建菜单后，可以重新计算 SlimScroll
        // $.AdminLTE.layout.fixSidebar();

        /*if ($.AdminLTE.options.sidebarSlimScroll) {
            if (typeof $.fn.slimScroll != 'undefined') {
                //Destroy if it exists
                var $sidebar = $(".sidebar");
                $sidebar.slimScroll({destroy: true}).height("auto");
                //Add slimscroll
                $sidebar.slimscroll({
                    height: ($(window).height() - $(".main-header").height()) + "px",
                    color: "rgba(0,0,0,0.2)",
                    size: "3px"
                });
            }
        }*/

    });

    var vm = new Vue({
        el:'#rrapp',
        data:{
            user:{},
            menuList:{},
            main:"main.html",
            password:'',
            newPassword:'',
            navTitle:"控制台"
        },
        methods: {
            getMenuList: function (event) {
                $.getJSON("sys/menu/nav?_"+$.now(), function(r){
                    vm.menuList = r.menuList;
                    $('.sidebar-menu').sidebarMenu({data: r.menuList});
                });
            },
            getUser: function(){
                $.getJSON("sys/user/info?_"+$.now(), function(r){
                    vm.user = r.user;
                });
            },
            updatePassword: function(){
                layer.open({
                    type: 1,
                    skin: 'layui-layer-molv',
                    title: "修改密码",
                    area: ['550px', '270px'],
                    shadeClose: false,
                    content: jQuery("#passwordLayer"),
                    btn: ['修改','取消'],
                    btn1: function (index) {
                        var data = "password="+vm.password+"&newPassword="+vm.newPassword;
                        $.ajax({
                            type: "POST",
                            url: "sys/user/password",
                            data: data,
                            dataType: "json",
                            success: function(result){
                                if(result.code == 0){
                                    layer.close(index);
                                    layer.alert('修改成功', function(index){
                                        location.reload();
                                    });
                                }else{
                                    layer.alert(result.msg);
                                }
                            }
                        });
                    }
                });
            },
            donate: function () {
                layer.open({
                    type: 2,
                    title: false,
                    area: ['806px', '467px'],
                    closeBtn: 1,
                    shadeClose: false,
                    content: ['http://cdn.renren.io/donate.jpg', 'no']
                });
            }
        },
        created: function(){
            this.getMenuList();
            this.getUser();
        }
    });


</script>


</body>
</html>